home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: New Zealand Amiga Users Group / New Zealand Amiga Users Group Newsdisk v27 (1989-12)(NZAmigaUG).zip / New Zealand Amiga Users Group Newsdisk v27 (1989-12)(NZAmigaUG).adf / SimGen / SimGen.doc < prev    next >
Text File  |  1993-12-03  |  19KB  |  386 lines

  1.  
  2.                           SimGen
  3.  
  4.                      by Gregg Tavares
  5.  
  6.                       © 1989 Echidna
  7.  
  8.                       BIX:   echidna
  9.                       PLINK: GreggT
  10.                       CIS:   72411,2772
  11.  
  12.  
  13. -=> SimGen, What does it do? <=-
  14.  
  15. Well, SimGen displays a 2 or 4 color IFF picture "behind" your WorkBench.  If
  16. the IFF picture is a digitized picture it looks much like a GenLocked
  17. Display; hence the name SIMGEN for 'SIMulated GENlock'.
  18.  
  19.  
  20. -=> How does SimGen work? <=-
  21.  
  22. SimGen Adds 1 or 2 bitplanes to your WorkBench Screen and loads the specified
  23. picture into these bitplanes.  Then it sets the colors for the desired
  24. effect.
  25.  
  26. Example SimGen color registers for a 4 color picture:
  27.  
  28.    Color 0  = Color 0 from PICTURE.
  29.    Color 1  = Color 1 from WorkBench.
  30.    Color 2  = Color 2 from WorkBench.
  31.    Color 3  = Color 3 from WorkBench.
  32.    Color 4  = Color 1 from PICTURE.
  33.    Color 5  = Color 1 from WorkBench.
  34.    Color 6  = Color 2 from WorkBench.
  35.    Color 7  = Color 3 from WorkBench.
  36.    Color 8  = Color 2 from PICTURE.
  37.    Color 9  = Color 1 from WorkBench.
  38.    Color 10 = Color 2 from WorkBench.
  39.    Color 11 = Color 3 from WorkBench.
  40.    Color 12 = Color 3 from PICTURE.
  41.    Color 13 = Color 1 from WorkBench.
  42.    Color 14 = Color 2 from WorkBench.
  43.    Color 15 = Color 3 from WorkBench.
  44.  
  45. To those that don't care how it works, just suffice it to say that it looks
  46. real neat!
  47.  
  48.  
  49. -=> Are there any negative side effects? <=-
  50.  
  51. Yes.
  52.  
  53. 1) SimGen takes about 25K to run and another 16K to 64K
  54.    for the picture it loads.  If you load a 2 color
  55.    picture on a 640x200 WorkBench the picture will take
  56.    16K.
  57.  
  58. WorkBench Size | Colors In Picture | Memory
  59. ---------------+-------------------+-----------
  60.    640x200     |        2          |   16K
  61.    640x200     |        4          |   32K
  62.    640x400     |        2          |   32K
  63.    640x400     |        4          |   64K
  64.    708x480     |        4          |   85K
  65.  
  66.  
  67. -=> What will SimGen Work With? <=-
  68.  
  69. SimGen should work with any size WorkBench Screen.  It most likely will not
  70. work with other WorkBench Hacks like DropCloth or DropShadow nor will it work
  71. with 8 and 16 color WorkBenchs.  It will work with Interlaced, Non-Interlaced
  72. and Overscan WorkBenchs (MoreRows).
  73.  
  74. Adding more colors to your WorkBench also slows it down. This is because the
  75. electronics in your Amiga that display graphics and your Amiga's CPU or 68000
  76. microprocessor can't both read your computers memory at the same time.  Much
  77. of the time this is not a problem.  The memory in your Amiga can only be read
  78. about 14 million times a second (I Think). The 68000 can normally only use
  79. the memory every other one of those times or 7 million times a second.  The
  80. creators of the Amiga designed it so that the display electronics (and other
  81. electronics for sound and disk support) read the memory the rest of the time
  82. and so everything runs smooth, but, when you have a screen that is HIRES (640
  83. or more pixels across) and more than 4 colors, the display electronic have to
  84. read lots of memory to display your graphics, more memory than they can read
  85. with their 7 million opportunities each second and so they use some of the
  86. 68000's opportunities which means your 68000 can't use the memory as often as
  87. usual which in turn means your Amiga will run a little slower.  (Other modes
  88. like Hold-And-Modify "HAM" and Extra-Halfbrite have the same effect.)
  89.   I haven't noticed SimGen slowing my Amiga down to much. Certainly not as
  90. much as DropCloth, DropShadow, or an 8 or 16 color WorkBench.  This is
  91. because all of those programs either actually draw on your WorkBench screen
  92. everytime you move a Window or they tell the WorkBench it has more colors and
  93. therefore the WorkBench must draw all its windows and graphics in 8 or 16
  94. colors instead of 4 which requires more work and takes more time.
  95.   SimGen adds colors to the WorkBench's display but it doesn't need to tell
  96. WorkBench about it so WorkBench still thinks it is only using 4 colors and
  97. therefore performs better.
  98.  
  99.  
  100. -=> How do I run it? <=-
  101.  
  102. SimGen may be run from the CLI or the WorkBench.
  103.  
  104. From the WorkBench, just single-click on any IFF Picture Icon, hold the shift
  105. button and double-click on the SimGen Icon.  (See picture requirements and
  106. suggestions below.)
  107.  
  108. You may also edit your Pictures' icons to run SimGen directly.  To do this,
  109. single-click on your chosen IFF Picture Icon and then choose "Info" from the
  110. "WorkBench" menu.  When the "Info" Window appears, click in the "Default
  111. Tool" box and change it from whatever it is to the path where you keep
  112. SimGen.  If you put SimGen in your C: directory then you would set the
  113. "Default Tool" to 'C:SimGen'.  If you keep SimGen in on a Disk named "Hacks"
  114. you might set the "Default Tool" to 'Hacks:SimGen'.
  115.  
  116. To "Remove" SimGen, from the WorkBench, Double-Click on the SimGen Icon.  A
  117. Small Help window should appear with the option to "Remove".  Click on it and
  118. SimGen will remove itself from your System.
  119.  
  120. From the CLI you would type SimGen [picture] where [picture] is the path and
  121. name of the picture you want to load.  If the picture you want to load is
  122. called 'RayTrace' and is on a disk in drive DF1: you would type
  123.  
  124.   SimGen DF1:RayTrace.
  125.  
  126. The problem with this is that you won't get your CLI back.  To get your CLI
  127. back make sure your CLI window is the active window and press CTRL-C.
  128.  (That's both the key labeled 'CTRL' on the left side of your keyboard and
  129. the 'C' key at the same time)  It is more likely you do not wish to tie up
  130. your CLI so you would usually type something like.
  131.  
  132.   run SimGen DF1:RayTrace
  133.  
  134. or
  135.  
  136.   runback SimGen DF1:RayTrace
  137.  
  138. When you do this you will not be able to use CTRL-C to remove SimGen.  To
  139. remove SimGen you may type
  140.  
  141.   SimGen -r
  142.  
  143. '-r' is for Remove.  Or you may send a CTRL-C to SimGen.  To do this type
  144.  
  145.   Status
  146.  
  147. You will see something like this.
  148.  
  149.   Process  1: Loaded as command: status
  150.   Process  2: Loaded as command: SimGen
  151.  
  152. Notice that it says Process 2 is SimGen.  Now to send a CTRL-C to process 2
  153. type
  154.  
  155.   Break 2
  156.  
  157. SimGen should exit Immediatly.
  158.  
  159. You don't need to "Remove" SimGen before you re-run it with another picture.
  160.  SimGen will remove the any previously loaded picture automatically.
  161.  
  162.  
  163. -=> How does SimGen handle IFF Pictures? <=-
  164.  
  165. SimGen will load any IFF picture but it will only use at most the first 2
  166. bitplanes (although it will load all the bitplanes of the picture.)  This
  167. means you would probably only want to use 2 or 4 color pictures.  SimGen will
  168. also only use as much of the picture as it can fit on the WorkBench Screen.
  169.  If the picture you load is bigger than the current WorkBench screen it will
  170. be centered and the edges chopped off.  If the picture you load is smaller,
  171. by default it will be centered in the middle of the screen.
  172.   There is an option to 'Tile' a small picture.  This option uses a small
  173. picture or brush as a 'pattern'.  If the brush you are using is called 'rods'
  174. and is in the current directory and you want to 'Tile' it you would type
  175. something like.
  176.  
  177.     run SimGen -t rods
  178.  
  179. This will start the 'Tiling' from the Top, Left corner of the screen.
  180.  Sometimes this is not desirable so you may give the picture an offset.
  181.  Typing
  182.  
  183.     run SimGen -t10,20 rods
  184.  
  185. will start the 'Tiling' 10 pixels from the left of the screen and 20 pixels
  186. from the top.
  187.  
  188. From the WorkBench you make select 'Tiling' by adding the line 'TILE' in your
  189. picture's 'Tool Types'.  (See Below for how to edit 'Tool Types'.)  You may
  190. set the tiling offset by specifing it after the word 'TILE' as in
  191. 'TILE=10,20' (Note: TILE must be all capital letters, the equal sign '=' is
  192. NOT optional, and you shouldn't have any spaces around the numbers.)
  193.  
  194.  
  195. -=> What other options does SimGen have? <=-
  196.  
  197. From the CLI       '-w' From the WorkBench 'WORKBENCH'
  198.  
  199. This option is supposed to keep SimGen around even after some other program
  200. has closed the WorkBench and the Re-Opened it.  I wasn't sure of a safe way
  201. to do this yet so it is NOT IMPLEMENTED.
  202.  
  203. From the CLI       '-k' From the WorkBench 'KEEPCOLORS'
  204.  
  205. This option is supposed to keep the colors correct even after some other
  206. program has changed them (like Preferences).  The colors are currently only
  207. set once when you first run the program as I couldn't think of a way to do
  208. this safely (yet.).  If you change your WorkBench colors while SimGen is
  209. running it would probably be best to re-run SimGen.
  210.  
  211. From the CLI        '-p<PickFile>' Not Available from the WorkBench
  212.  
  213. This option allows you to create a text file that lists all the pictures you
  214. might like to use with SimGen.  SimGen will the look at that file and pick
  215. one picture at random.  The first line of the file should contain the number
  216. of choices SimGen has to pick from.  The rest of the lines should contain the
  217. choices in the form of Double-Quoted filenames. An Example PickFile might
  218. look like this.
  219.  
  220. 3 "Pictures:Bozo" "Pictures:RayTrace" "Pictures:Rods"t10,20
  221.  
  222. Notice the last line contains the 'Tiling option'. If you want picture tiled
  223. you must put a 't' immediatly after the closing double-quote followed by
  224. optional offset information.  If you save this PickFile as 'PictureList' in
  225. the current directory you would use it by typing
  226.  
  227.    run SimGen -pPictureList
  228.  
  229. You would most likely use this option in your startup-sequence if you are
  230. lucky enough to have a Hard Drive and you want SimGen to pick a picture at
  231. random everytime you turn on/reboot your Amiga.
  232.   If the list of pictures is short you may specify them on the command line
  233. as in
  234.  
  235.     run SimGen Pictures:Bozo Picture:RayTrace.
  236.  
  237. Note: You can't specify separate Tiling options for each picture from the
  238. command line.
  239.  
  240.  
  241. -=> How to Set Tool Types. <=-
  242.  
  243. Setting 'Tool Types' of a picture is much like setting the 'Default Tool' of
  244. a picture.  First, single-click on your chosen picture.  Then choose "Info"
  245. from the "WorkBench" menu.  When the "Info" Window appears, click on the
  246. "ADD" button in the 'Tool Types' area.  This will add another 'Tool Type'.
  247.  Type the option you wish to add and press RETURN.  Now click 'SAVE' on the
  248. lower left area of the "Info" Window.  (For more information on Editing 'Tool
  249. Types' see your Amiga User's Guide).  Note: The Info Window's 'Tool Types'
  250. edit options are buggy and will sometime mess up your 'Tool Types.'  If you
  251. set your 'Tool Types' and then Click on the Picture Icon and the option you
  252. set doesn't work.  Check to see (by bringing up the "Info" window again) that
  253. the "Info" window correctly saved your 'Tool Types.'
  254.  
  255.  
  256. -=> Requirements and Suggestions for Pictures <=-
  257.  
  258. Most of the picture included with SimGen were pictures found on local BBSes
  259. and from Users Group that we ran through the Digi-View 3.0 software.  You can
  260. by this software for as little as $15 at your local Amiga Dealer/Mail Order
  261. House.  This software is an invaluable tool for image processing (without
  262. buying the actual Digi-View Digitizer that the software was written for).  It
  263. will allow you to choose a display mode and a number of colors and then will
  264. load any IFF picture and 'massage' the picture into the requested mode with
  265. dithering and all.  This is much more than Pixmate or Butcher will do in this
  266. particular area.
  267.   We chose HIRES (YES) / INTERLACE (NO) when entering Digi-View 3.0.  If you
  268. are making SimGen pictures for an Interlaced WorkBench then Choose INTERLACE
  269. (YES).  Now, click " OK " after getting the "No Video Signal Present"
  270. message.   Go to the menus and from the "Controls" menu choose "Palette".
  271.  Now set the colors to 4 then chose "OK". Now Load any IFF Picture.  It will
  272. take a while to load because Digi-View is expanding the picture into it's own
  273. internal format so that it can munipulate it better.  Once it is done
  274. loading, it will draw the picture in 4 colors.
  275.   There are many options in Digi-View that will help you get the best
  276. results.  Here are a few of tips.
  277.   1) Since we told Digi-View it could only use 4 colors it has to pick 4
  278. colors to use.  Usually it picks the 4 most common colors in the picture.  If
  279. you have a picture of a brown tree with green leaves but most of the picture
  280. is dithered shades of blue sky, Digi-View might pick four shades of blue
  281. which means the tree and its leaves will be drawn in dithered shades of blue.
  282.  This is not always what you want.  Fortunately Digi-View will let you choose
  283. the colors it should use.  Bring up the Palette Requester by choosing
  284. "Palette" from the "Controls" menu.  Now set one of the blues, in the first
  285. four colors (the ones against the left side of the screen.) to a shade of
  286. green similar to the green of the leaves.  Set another one of the blues to a
  287. shade of brown similar to the shade of the tree.  Then choose "Freeze
  288. Palette".  This will force Digi-View to use those colors.  Click on "Display"
  289. and Digi-View will re-draw your picture with the new colors.  (NOTE 1:
  290. Whenever you want Digi-View to re-draw the picture you must choose "Display"
  291. either from a button or from the Menus.  Choosing "OK" will not work.  NOTE
  292. 2: If you load another picture, you should first choose "Make New Palette"
  293. from the "Palette Requester" or Digi-View will be forced to draw the new
  294. picture with the old pictures colors.)
  295.   2) Once you have a good looking picture it is best to dim the colors.  You
  296. can use Digi-View's "Palette Requester" for this, or some other program.
  297.  (Programs like Colors (From Deluxe PhotoLab), PixMate and Butcher are great
  298. for dimming all the colors.)  The Standard white letters of the WorkBench
  299. show up well against dim/dark colors.  Also note that alot of black in your
  300. SimGen pictures is usually not a good choice because black is often a
  301. standard WorkBench color and so black objects on the WorkBench won't show up
  302. well against a largely black SimGen picture.
  303.   3) For Digitized pictures it is very easy to get decent results by first
  304. telling Digi-View to draw the picture in black and white and then changing
  305. the black and white colors to other hues using Digi-View or some other
  306. program.
  307.  
  308.  
  309. -=> Notes for Other programmers. <=-
  310.  
  311. SimGen adds bitplanes to the WorkBench by first getting the Address of the
  312. WorkBench Screen though the SimGen Credits Window.  Then, from the WorkBench
  313. Screen it makes a copy of its ViewPort's RasInfo's BitMap.  It adds the new
  314. bitplanes to this copy, points the RasInfo to the copy bitmap and then calls
  315. RemakeDisplay ().  When exiting it points the RasInfo back to it's original
  316. bitmap and again calls RemakeDisplay ().  If there is any reason you know
  317. this won't work AND you know a fix for it I would like to hear of it.
  318.  
  319. The reason the WORKBENCH and KEEPCOLOR options are not implemented is that I
  320. could not think of any reasonable way to do it.  I thought I could
  321. SetFunction, LoadRGB4, SetRGB4 and OpenWorkBench, but when the WorkBench
  322. re-opens I don't know how to get its address except to open a window on it
  323. (which I obviously can't do inside these patches.)  If you have any ideas,
  324. I'd be happy to hear them.
  325.  
  326.  
  327. -=> Where did I get the idea for SimGen <=-
  328.  
  329. Well, I was at one of my local computer stores and I noticed one of the
  330. Amigas there had what I thought was a DropCloth Picture.  As I used the
  331. machine I noticed that is was more than a DropCloth.  The picture showed
  332. through all the windows including the TxEd window I was using to edit a
  333. script.  It looked pretty cool so I looked at their startup-sequence, found
  334. out what it ran to add the picture to the WorkBench and made a copy of it
  335. along with some of the pictures they used with it.  The program was called
  336. "Tapestry" written by Joe Hitchens.  I took it home and decided to show it to
  337. my roommates, but the pictures I had copied were all 640x400x1 or bigger
  338. (used on an Interlaced WorkBench.)  I don't use an Interlaced WorkBench so I
  339. set out to make some 640x200x1 pictures for my WorkBench to show off this new
  340. program.  Well, as I was creating pictures in Digi-View I accidently made a 4
  341. color picture instead of a 2 color.  I looked at it and thought "WOW! That's
  342. really good for 2 colors."  Then I noticed it was 4 colors.  I thought about
  343. it for a moment and knew it should be trivial to support 4 colors instead of
  344. 2 and I thought maybe "Tapestry" might already support 4 colors so I tried
  345. the 4 color picture.  Nope, "Tapestry" only displayed 1 bitplane of my
  346. picture. So, I thought, maybe there's a newer version on the 'boards'.  I
  347. called Compuserve. Nothing.  I called PeopleLink and found "Tapestry" and
  348. "Tapestry Version 2."  The small online description said it supported 4
  349. colors.  So, I downloaded it and tried it out.  No luck!  The documentation
  350. said that 4 colors as well as tiling/pattern were to be added to a future
  351. version.  The doumentation was dated March 18, 1989.  It shouldn't take more
  352. than 38 seconds to add 4 color support I thought, so I decided that since it
  353. was now June 4, 1989, 38 seconds had long passed since the last version of
  354. "Tapestry", and, given this, the author must have died or something.  So,
  355. instead of waiting for who knows how many more months for a 4 color version I
  356. decided to write my own.
  357.   "Tapestry" version 2 was only 11.3K big.  SimGen is 22.8.   Sorry about the
  358. size increase.  It is mostly because my IFF routines are the Electronic
  359. Arts/Commodore Amiga IFF routines heavily modified for extra functionality
  360. but not code size.
  361.   The IFF routines will load any type of IFF ILBM file including color
  362. cycling info, and ViewMode.  They will read any part of a picture to any part
  363. of a bitmap or rastport and will create the bitmap and rastport if necessary.
  364.  They will also clip to a bitmap/rastport that is smaller then the picture.
  365.  When is Commodore Amiga going to supply OS level IFF support since 50% or
  366. more of all Amiga programs could benefit from it!  I've been thinking about
  367. turning my IFF routines into a sharable library, they would be large but they
  368. would work and they do an awful lot of work.  As a sharable library they
  369. could also be updated with smaller and faster versions.
  370.   The other things that added size to SimGen are, WorkBench Support , Tiling
  371. and WorkBench Help.  The Help routines I've had for a while.  I wish
  372. Commodore Amiga would add similar routines to the Amiga OS so I wouldn't have
  373. to add them to every program I write.  (AutoRequesters are too ugly and not
  374. as functional IMHO.)
  375.  
  376.  
  377.  -=> Distrubution <=-
  378.  
  379. This program may be distrubuted as long as it is done so free of charge and
  380. all the files in the ZOO are kept together.  It may be placed on BBSes and in
  381. PD Disk Collections.  It is in other words, copywritten but Freely
  382. ReDistribuatable.
  383.  
  384. Have fun with it.  I wasted two nights writing it. :-)
  385.  
  386.